﻿namespace Snipps
{
    using SimpleInjector;

    using Snipps.Core;
    using Snipps.Infrastructure.Services;
    using Snipps.Model;
    using Snipps.Services;
    using Snipps.ViewModels;

    public class Bootstrapper
    {
        private Container _container;

        public Container Container
        {
            get
            {
                return _container;
            }
        }

        public void Run()
        {
            _container = new Container();

            WireDependencies();
        }

        private void WireDependencies()
        {
            _container.Register<ISettings, AppSettings>(Lifestyle.Singleton);
            _container.Register<IThreadingService, TasksThreadingService>(Lifestyle.Singleton);
            _container.Register<IExportImportSnippetService, ClipboardExportImportSnippetService>(Lifestyle.Singleton);
            _container.Register<IWindowOperationsService, WindowOperationsService>(Lifestyle.Singleton);
            _container.Register<ISnippetsDataContext, SnippetsDataContext>(Lifestyle.Singleton);
            _container.Register<MainViewModel,MainViewModel>(Lifestyle.Singleton);
        }
    }
}